import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/fzAllSize',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/fzAllSize/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/fzAllSize',
    method: 'put',
    data
  })
}

export function getImage(id) {
  return request({
    url: 'api/file_upload/image/query?bid=' + id,
    method: 'get'
  })
}

export function downloadZip(id, zipName) {
  return request({
    url: 'api/file_upload/downloadZip?bid=' + id + '&zipName=' + zipName,
    method: 'get',
    responseType: 'blob'
  })
}

export function deleteFile(id) {
  return request({
    url: 'api/file_upload/deleteFile?bid=' + id,
    method: 'get'
  })
}

export function copyTo(id, type) {
  return request({
    url: 'api/fzAllSize/copy?bid=' + id + '&type=' + type,
    method: 'get'
  })
}

export default { add, edit, del, getImage, downloadZip, deleteFile, copyTo }
